package wangjg.mda.gen;

import java.io.File;
import java.lang.reflect.Method;
import java.util.Map;

/**
 * 包装为实现接口但有相同方法的的类
 * @author wangjg
 *
 */
public class PreprocessorWrapper implements Preprocessor{
	private Object obj;
	
	public PreprocessorWrapper(Object obj) {
		this.obj = obj;
	}

	public void process(Map<String,Object> rootMap, File templFile){
		if(obj==null){
			return;
		}
		try {
			Method method = obj.getClass().getMethod("process", Map.class, File.class);
			method.invoke(obj, rootMap, templFile);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
}